<template>
  <div class="bgColor">
    <div class="box mainbox">
      <div class="daohang">
        <span class="current">当前位置：</span
        ><span class="newstext" @click="goBack">新闻中心</span
        ><img src="../assets/right.png" alt="" /><span class="text"
          >新闻详情</span
        >
      </div>
      <div class="contentbox">
        <p class="newtitle">{{ infoData.title }}</p>
        <p class="time">{{ infoData.datePublish }}</p>
        <div class="detailbox" v-html="infoData.content"></div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { useRoute, useRouter } from 'vue-router'
import { newsdetail } from '@/api/api.js'
const router = useRouter()
const route = useRoute()
function goBack() {
  router.go(-1)
}
const infoData = ref({})
function newsdetailApi() {
  newsdetail({ id: route.query.id }).then((res) => {
    infoData.value = res.data
  })
}
newsdetailApi()
</script>

<style lang="scss" scoped>
.time {
  font-family: Source Han Sans CN, Source Han Sans CN;
  font-weight: 400;
  font-size: 14px;
  color: #5c5e66;
  text-align: center;
  margin-top: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e1e7f0;
  margin-bottom: 30px;
}
.newtitle {
  font-family: Source Han Sans CN, Source Han Sans CN;
  font-weight: 500;
  font-size: 24px;
  color: #2e2f33;
  text-align: center;
}
.contentbox {
  min-height: 600px;
  background: #fff;
  border-radius: 8px 8px 8px 8px;
  margin-bottom: 60px;
  padding: 30px 140px;
}
.text {
  font-family: Source Han Sans CN, Source Han Sans CN;
  font-weight: 400;
  font-size: 14px;
  color: #8d9099;
}
.newstext {
  font-family: Source Han Sans CN, Source Han Sans CN;
  font-weight: 400;
  font-size: 14px;
  color: #178fd1;
  cursor: pointer;
}
.current {
  font-family: Source Han Sans CN, Source Han Sans CN;
  font-weight: 400;
  font-size: 14px;
  color: #2e2f33;
}
.daohang {
  display: flex;
  align-items: center;
  padding: 30px 0;
}

.box {
}
</style>